// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import "fmt"

func checkSortedArray(array []int) (sortedArray bool) {
	sortedArray = true
	for i := 0; i <= len(array)-1; i++ {
		for j := 0; j < len(array)-1-i; j++ {
			if array[j] > array[j+1] {
				sortedArray = false
				break
			}
		}
	}

	return
}

func main() {
	array := []int{99, 66, 57, 89, 36, 69, 98}
	res := checkSortedArray(array)
	fmt.Println(res)
}

//$ go run interview6-6.go
//false
